<html>
<head>
<meta charset="UTF-8">
<title>插件参数模板配置修改</title>
<link  id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<link href="../../static/css/esaas-easyui-edit.css" rel="stylesheet" type="text/css"/>
<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../ffres/dict/all.js" type="text/javascript"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout" scroll="no">
	<form id="ff" method="post">
		<div class="esaas-info-title">配置插件参数模板</div>
		<table class="esaas-info-edit-table">
			<tr>
				<td width="15%" align="right">参数标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="paramId"
									   name="paramId" data-options="required:true, disabled: true"
									   style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">插件ID：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="pluginId"
									   name="pluginId" data-options="required:true, disabled: false"
									   style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">参数类别：</td>
				<td width="35%"><select class="easyui-combobox"
										id="paramCategory" name="paramCategory"
										style="width: 100%; height: 25px;"
										data-options="required:true,editable:false,valueField:'enname',textField:'cnname',data:PARAM_CATEGORY">
				</select></td>
			<tr/>
			<tr>
				<td width="15%" align="right">参数代码：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="paramCode"
									   name="paramCode" data-options="required:true, disabled: false"
									   style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">参数名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="paramName"
									   name="paramName" data-options="required:true, disabled: false"
									   style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">参数HTML标签：</td>
				<td width="35%"><select class="easyui-combobox"
										id="paramHtmlTag" name="paramHtmlTag"
										style="width: 100%; height: 25px;"
										data-options="required:true,editable:false,valueField:'enname',textField:'cnname',data:PARAM_HTML_TAG">
				</select></td>
			<tr/>
			<tr>
				<td width="15%" align="right">参数HTML选项：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="paramHtmlOption"
									   name="paramHtmlOption" data-options="required:false, disabled: false"
									   style="width: 100%; height: 25px;"></input></td>

				<td width="15%" align="right">参数排序：</td>
				<td width="35%"><input class="easyui-numberbox" type="text" id="paramOrderId"
									   name="paramOrderId" data-options="required:false, disabled: false"
									   style="width: 100%; height: 25px;" data-options="min:1"></input></td>

				<td width="15%" align="right">父参数标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text" id="parentParamId"
									   name="parentParamId" data-options="required:false, disabled: false"
									   style="width: 100%; height: 25px;"></input></td>
			</tr>
		</table>
	</form>
	<div style="text-align: center; padding: 15px">
		<a href="javascript:void(0)" iconCls="icon-ok" class="easyui-linkbutton"
		   onclick="submitForm()">&nbsp;保&nbsp;存&nbsp;</a> <a
			href="javascript:void(0)" iconCls="icon-cancel" class="easyui-linkbutton"
			onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
	</div>
	<script>		
		$(function() {
            addTitle("修改");
			var paramId = $.getUrlParam('paramId');
			$.restfulGet('../../api/plugin/param/template/config/' + paramId,null,function(data){
					$('#ff').form('load', {
						paramId : data.rows.paramId,
						pluginId : data.rows.pluginId,
						paramCategory : data.rows.paramCategory,
						paramCode : data.rows.paramCode,
						paramName : data.rows.paramName,
						paramHtmlTag : data.rows.paramHtmlTag,
						paramHtmlOption : data.rows.paramHtmlOption,
						paramOrderId : data.rows.paramOrderId,
						parentParamId : data.rows.parentParamId
					});
			});
		});
	
		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			var jsonData = $("#ff").serializeJson();
			$.restfulPut('../../api/plugin/param/template/config', jsonData, function(data) {
				window.parent.reloadList();
			});
		};
		
		function closeForm(){
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>
